/**
 * @Author: hl
 * @Date: 2019/8/16
 * @Last Modified by: hl
 * @Last Modified time:
 */

import axios from '@/api/fetch';
import SERVER from '@/api/server';

// 预收款客户查询
export const search = params => axios.get(`${SERVER.CYXDMS_FINANCE}/advancesOrder/search`, { params });

// 删除记录
export const doRemove = params => axios.get(`${SERVER.CYXDMS_FINANCE}/advancesOrder/deleteById`, { params });

// 保存预收款
export const save = params => axios.post(`${SERVER.CYXDMS_FINANCE}/advancesOrder/save`, params);

// 取消上报
export const cancelReport = params => axios.get(`${SERVER.CYXDMS_FINANCE}/advancesOrder/cancelReport`, { params });

// 结算方式查询
export const gatheringType = params => axios.get(`${SERVER.DMSCLOUD_BASEDATA}/gathering/gatheringType/dle?`, { params });

// 保存预收款
export const affirmSave = params => axios.post(`${SERVER.CYXDMS_FINANCE}/advancesOrder/affirmSave`, params);

// 根据Id查询详细记录
export const searchDetailsByOrderNo = params => axios.get(`${SERVER.CYXDMS_FINANCE}/advancesOrder/searchDetailsByOrderNo`, { params });

// 退款-根据原单号查询可退款数据
export const searchOriginDetailsByOrderNo = params => axios.get(`${SERVER.CYXDMS_FINANCE}/advancesOrder/searchOriginDetailsByOrderNo`, { params });

// 根据Id查询详细记录
export const searchRefundDetailsByOrderNo = params => axios.get(`${SERVER.CYXDMS_FINANCE}/advancesOrder/searchRefundDetailsByOrderNo`, { params });

// 上报预收款
export const report = params => axios.post(`${SERVER.CYXDMS_FINANCE}/advancesOrder/report`, params);

// 确认
export const affirm = params => axios.get(`${SERVER.CYXDMS_FINANCE}/advancesOrder/affirm`, { params });

// 取消确认
export const cancelAffirm = params => axios.get(`${SERVER.CYXDMS_FINANCE}/advancesOrder/cancelAffirm`, { params });

// 退款查询预收款单据
export const queryAdvancesLikeNo = params => axios.get(`${SERVER.CYXDMS_FINANCE}/advancesOrder/queryAdvancesLikeNo`, { params });
